<!--
* @author GJS
* @date 2023/07/18 15:32:29
* @description 递归组件
* @fileName index.vue
!-->
<script setup lang="ts">
const props = defineProps({
  treeData: {
    type: Array,
    default: () => [],
    required: true
  }
})
</script>

<template>
  <component
      v-for="item in treeData"
      :key="item.id"
      :is="item.name"
      v-bind="item"
  >
    <template v-if="item.children && item.children.length">
      <Recursion :treeData="item.children"/>
    </template>
  </component>
</template>